package com.jasonchoi.security;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: JasonChoi
 * @Date: 2020/1/10 11:10
 */
@RestController
@RequestMapping
public class TestController {

    //第一步 获取授权码
    // http://localhost:8020/oauth/authorize?client_id=myClientId&response_type=code&redirect_uri=http://localhost:8020

    //第二步 通过授权码 获取access_token POST
    // http://localhost:8020/oauth/token?grant_type=authorization_code&code=授权码&redirect_uri=http://localhost:8020&client_id=myClientId&client_secret=mySecret

    @RequestMapping("/resource/auth")
    public String authTest(){
        return "受保护资源";
    }

    @RequestMapping("/unauth")
    public String unauthTest(){
        return "未被保护资源";
    }
}
